From: Maxim Ermilov Date: Wed, 15 Sep 2010 11:52:20 +0000 (+0400) Subject: Cancel Destroy effect of modal windows when the parent has gone away X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9749 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5ccc76338565520665c1c211eebf1d9411025b16;p=gnome-shell.git Cancel Destroy effect of modal windows when the parent has gone away Modal dialogs slide back into the titlebar of the parent window when destroyed. This looks weird if the parent window itself has been destroyed, so cancel the effect in this case. https://bugzilla.gnome.org/show_bug.cgi?id=629560 --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index d6945537b..da77c10a0 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -334,15 +334,10 @@ WindowManager.prototype = { } }, - _destroyWindowOverwrite : function(shellwm, actor) { - if (this._removeEffect(this._mapping, actor)) { - shellwm.completed_destroy(actor); - } - }, - - _destroyWindow : function(shellwm, actor) { + _destroyWindow : function(shellwm, actor) { + let parent = actor.get_meta_window().get_transient_for(); while (actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG - && actor.get_meta_window().get_transient_for()) { + && parent) { if (!Main.overview.visible) this._undimParentWindow(actor, true); this._dimmedWindows = this._dimmedWindows.filter(function(win) { @@ -353,7 +348,12 @@ WindowManager.prototype = { break; actor.set_scale(1.0, 1.0); actor.show(); - this._mapping.push(actor); + this._destroying.push(actor); + + actor._parentDestroyId = parent.connect('unmanaged', Lang.bind(this, function () { + Tweener.removeTweens(actor); + this._destroyWindowDone(shellwm, actor); + })); Tweener.addTween(actor, { scale_y: 0, @@ -362,7 +362,7 @@ WindowManager.prototype = { onComplete: this._destroyWindowDone, onCompleteScope: this, onCompleteParams: [shellwm, actor], - onOverwrite: this._destroyWindowOverwrite, + onOverwrite: this._destroyWindowDone, onOverwriteScope: this, onOverwriteParams: [shellwm, actor] }); @@ -372,11 +372,13 @@ WindowManager.prototype = { }, _destroyWindowDone : function(shellwm, actor) { - if (actor && actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG && - actor.get_meta_window().get_transient_for()) { - if (this._removeEffect(this._mapping, actor)) { - shellwm.completed_destroy(actor); + if (this._removeEffect(this._destroying, actor)) { + let parent = actor.get_meta_window().get_transient_for(); + if (parent && actor._parentDestroyId) { + parent.disconnect(actor._parentDestroyId); + actor._parentDestroyId = 0; } + shellwm.completed_destroy(actor); } },